package response

import "tuowei.com/app/admin/models"

type ClassStudentsResponse struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	IdCard   string `json:"id_card"`
	Avator   string `json:"avator"`
	UserType string `json:"user_type"`
}

type ClassDetailResponse struct {
	Id                int    `json:"id"`
	Name              string `json:"name"`
	CollegeName       string `json:"college_name"`
	HeadMasterName    string `json:"head_master_name"`
	ClassType         string `json:"class_type"`
	Class             string `json:"class"`
	Address           string `json:"address"`
	TeachingPointName string `json:"teaching_point_name"`
}

func (c *ClassDetailResponse) Make(class models.SysClass) {
	c.Id = class.Id
	c.Name = class.Name
	c.HeadMasterName = class.HeadMasterName
	c.Class = class.Class
	c.ClassType = class.Class
	if class.Dept != nil {
		c.TeachingPointName = class.Dept.Name
		c.Address = class.Dept.Address
	}
}
